import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Home  from '../components/Home'
import Computer  from '../components/Computer'
import Phone  from '../components/Phone'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',//默认路由到HelloWorld
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/home',//默认路由到HelloWorld
      name: 'home',
      component: Home
    },
    {
      path: '/computer/:id',//  设置参数
      name: 'computer',
      component: Computer
    },{
      path: '/phone',//phone
      name: 'phone',
      component: Phone
    }
  ]
})
